<template>
    <div class="flex">
      <!-- <left :setpData="setpData"></left> -->
      <div class="apply_right">
        <steps-demo :stepsObj="stepsObj"></steps-demo>
        <div class="right_form"></div>
        <div class="form_item">
          <div class="item">
            <div class="item_title">
              <span class="cole53">*</span> 1.设置报名字段
              <span class="label">设置后，用户需要填写相关字段才能报名成功</span>
            </div>
            <div class="change_body">
              <el-select
                class="wid150"
                v-model="ruleForm.applyType"
                placeholder="默认字段"
                @change="changeType"
              >
                <el-option
                  v-for="item in applyTypeData"
                  :key="item.name"
                  :label="item.name"
                  :value="item.value"
                ></el-option>
              </el-select>
              <div>
                <el-checkbox-group v-model="checkType">
                  <el-checkbox label="姓名" name="type" disabled></el-checkbox>
                  <el-checkbox label="单位" name="type" disabled></el-checkbox>
                  <el-checkbox label="手机号" name="type" disabled></el-checkbox>
                  <el-checkbox
                    label="所属行业"
                    name="type"
                    disabled
                  ></el-checkbox>
                  <el-checkbox label="邮箱" name="type" disabled></el-checkbox>
                  <el-checkbox label="地址" name="type" disabled></el-checkbox>
                  <el-checkbox
                    label="单位类型"
                    name="type"
                    disabled
                  ></el-checkbox>
                  <el-checkbox
                    label="职业类型"
                    name="type"
                    disabled
                  ></el-checkbox>
                </el-checkbox-group>
              </div>
            </div>
          </div>
          <div class="item">
            <div class="item_title">
              <span class="cole53">*</span> 2.是否设置参会问卷
              <span class="pl16">
                <el-radio-group v-model="ruleForm.isSetQuestion">
                  <el-radio :label="1">是</el-radio>
                  <el-radio :label="0">否</el-radio>
                </el-radio-group>
              </span>
            </div>
            <div class="change_body" v-if="ruleForm.isSetQuestion==1">
              <span class="col7e8"
                >选择问卷模板：用户在报名时，需要填写问卷后才能报名成功</span
              >
              <div class="last_body mt16">
                <!-- <span class="last_title">问卷模板</span> -->
                <!-- <el-select
                  class="wid330"
                  v-model="ruleForm.region"
                  placeholder="默认字段"
                >
                  <el-option v-for="item in selectMeetingTemplateData" :key="item.templateId" :label="item.templateName" :value="item.templateId"></el-option>
                </el-select> -->
                <span
                  v-if="templateID && SZdialog == false"
                  class="ed_sz"
                  @click="checkTemplate()"
                  >已设置参会问卷 点击查看</span
                >
                <span v-else style="color: #202933; padding-right: 24px"
                  >未设置参会问卷</span
                >
  
                <span class="mn_butn" @click="SZdialogfn()">设置问卷</span>
              </div>
            </div>
          </div>
          <div class="item">
            <div class="item_title">
              <span class="cole53">*</span> 3.设置会议宣传图
            </div>
            <div class="change_body">
              <div class="last_body mt16">
                <ImgList
                  v-if="changeImgStatus"
                  v-model="ruleForm.meetingImageVO.banner1"
                  :limit="limitImg"
                  :image="
                    ruleForm.meetingImageVO.banner1 != null &&
                    ruleForm.meetingImageVO.banner1.toLowerCase().indexOf('http') == -1
                      ? `https://img1.17img.cn/17img/${ruleForm.meetingImageVO.banner1}`
                      : ruleForm.meetingImageVO.banner1
                  "
                  @imgListSucenss="imgListSucenss1"
                  @imgListDelete="imgListDelete1"
                />
                <span class="fs12 col7e8" style="padding-left: 16px"><div class="fs16 bold pb16">电脑端会议详情页宣传图</div>尺寸：1920*420px；格式：JPG/PNG  </span>
              </div>
            </div>
            <div class="change_body">
              <div class="last_body mt16">
                <ImgList
                  v-if="changeImgStatus"
                  v-model="ruleForm.meetingImageVO.meeting1"
                  :limit="limitImg"
                  :image="
                    ruleForm.meetingImageVO.meeting1 != null &&
                    ruleForm.meetingImageVO.meeting1.toLowerCase().indexOf('http') == -1
                      ? `https://img1.17img.cn/17img/${ruleForm.meetingImageVO.meeting1}`
                      : ruleForm.meetingImageVO.meeting1
                  "
                  @imgListSucenss="imgListSucenss2"
                  @imgListDelete="imgListDelete2"
                />
                <span class="fs12 col7e8" style="padding-left: 16px"><div class="fs16 bold pb16">电脑端首页宣传图</div>尺寸：690*350px；格式： JPG/PNG </span>
              </div>
            </div>
            <div class="change_body">
              <div class="last_body mt16">
                <ImgList
                  v-if="changeImgStatus"
                  v-model="ruleForm.meetingImageVO.wapbanner"
                  :limit="limitImg"
                  :image="
                    ruleForm.meetingImageVO.wapbanner != null &&
                    ruleForm.meetingImageVO.wapbanner.toLowerCase().indexOf('http') == -1
                      ? `https://img1.17img.cn/17img/${ruleForm.meetingImageVO.wapbanner}`
                      : ruleForm.meetingImageVO.wapbanner
                  "
                  @imgListSucenss="imgListSucenss3"
                  @imgListDelete="imgListDelete3"
                />
                <span class="fs12 col7e8" style="padding-left: 16px"><div class="fs16 bold pb16">手机端会议宣传图</div>尺寸：640*300px；格式： JPG/PNG </span>
              </div>
            </div>
            <div class="change_body">
              <div class="last_body mt16">
                <ImgList
                  v-if="changeImgStatus"
                  v-model="ruleForm.meetingImageVO.appIndexImage"
                  :limit="limitImg"
                  :image="
                    ruleForm.meetingImageVO.appIndexImage != null &&
                    ruleForm.meetingImageVO.appIndexImage.toLowerCase().indexOf('http') == -1
                      ? `https://img1.17img.cn/17img/${ruleForm.meetingImageVO.appIndexImage}`
                      : ruleForm.meetingImageVO.appIndexImage
                  "
                  @imgListSucenss="imgListSucenss4"
                  @imgListDelete="imgListDelete4"
                />
                <span class="fs12 col7e8" style="padding-left: 16px"><div class="fs16 bold pb16">手机端首页轮播图</div>尺寸：1035*345px；格式： JPG/PNG</span>
              </div>
            </div>
            <div class="change_body">
              <div class="last_body mt16">
                <ImgList
                  v-if="changeImgStatus"
                  v-model="ruleForm.meetingImageVO.seminarimg"
                  :limit="limitImg"
                  :image="
                    ruleForm.meetingImageVO.seminarimg != null &&
                    ruleForm.meetingImageVO.seminarimg.toLowerCase().indexOf('http') == -1
                      ? `https://img1.17img.cn/17img/${ruleForm.meetingImageVO.seminarimg}`
                      : ruleForm.meetingImageVO.seminarimg
                  "
                  @imgListSucenss="imgListSucenss5"
                  @imgListDelete="imgListDelete5"
                />
                <span class="fs12 col7e8" style="padding-left: 16px"><div class="fs16 bold pb16">微信分享图片</div>尺寸：400*300px；格式： JPG/PNG </span>
              </div>
            </div>
          </div>
          <div class="right_btm">
            <el-button @click="saveDrafts()">保存草稿箱</el-button>
            <el-button type="primary" @click="submitForm('ruleForm')"
              >保存并提交审核</el-button
            >
          </div>
        </div>
        <el-dialog
          title="新增联系人"
          :visible.sync="LinksDia"
          width="420px"
          center
          :close-on-click-modal="false"
        >
          <div>
            <el-form ref="form" :model="formLinks" label-width="80px">
              <el-form-item label="姓名">
                <el-input v-model.trim="formLinks.linkname"></el-input>
              </el-form-item>
  
              <el-form-item label="手机号">
                <el-input v-model.trim="formLinks.tel"></el-input>
              </el-form-item>
              <el-form-item label="邮箱">
                <el-input v-model.trim="formLinks.email"></el-input>
              </el-form-item>
            </el-form>
          </div>
          <span slot="footer" class="dialog-footer">
            <el-button type="primary" @click="saveLinks()">确定</el-button>
            <div class="gl_css" @click="mangePeople()">管理会议联系人</div>
          </span>
        </el-dialog>
        <div class="mangedia">
          <el-dialog
            title="管理联系人"
            :visible.sync="MangeLinkDia"
            width="640px"
            center
            :close-on-click-modal="false"
          >
            <div class="dia_flex">
              <div class="mange_left">
                <span
                  v-for="(item, index) in LinksData"
                  :key="item.id"
                  :class="[active == index ? 'active' : '']"
                  @click="changeLinkes(item, index)"
                  >{{ item.linkname }}</span
                >
              </div>
              <div class="mange_right">
                <el-form ref="form" :model="formLinks" label-width="80px">
                  <el-form-item label="手机号">
                    <el-input
                      class="wid280"
                      v-model.trim="mangeFrom.tel"
                    ></el-input>
                  </el-form-item>
                  <el-form-item label="邮箱">
                    <el-input
                      class="wid280"
                      v-model.trim="mangeFrom.email"
                    ></el-input>
                  </el-form-item>
                  <el-form-item>
                    <el-button @click="deletedLink()">删除</el-button>
                    <el-button type="primary" @click="saveLinks(2)"
                      >修改</el-button
                    >
                  </el-form-item>
                </el-form>
              </div>
            </div>
          </el-dialog>
        </div>
        <el-dialog
          title="设置问卷"
          :visible.sync="SZdialog"
          width="480px"
          center
          :close-on-click-modal="false"
        >
          <div style="text-align: center; margin-bottom: 20px">
            <div
              style="color: #4f5862;margin-bottom: 7px;text-align: left;"
            >
              请选择模版：
            </div>
            <div class="flex">
              <el-select class="wid340" v-model="templateID" filterable  placeholder="默认字段">
              <el-option
                v-for="item in selectMeetingTemplateData"
                :key="item.templateId"
                :label="item.templateName"
                :value="item.templateId"
              ></el-option>
            </el-select>
            <el-button class="ml16" @click="addTemplate()">新增模板</el-button>
            </div>
     
          </div>
          <span slot="footer" class="dialog-footer" style="margin: 20px 0">
            <el-button type="primary" @click="choosetemplete()">确定</el-button>
          </span>
        </el-dialog>
        <el-dialog
          title="参会问卷"
          :visible.sync="selectQuestionDia"
          width="800px"
          center
          :close-on-click-modal="false"
        >
          <div class="question_body">
            <div
              class="question_list"
              v-for="(item, index) in selectQuestion"
              :key="item.questionid"
            >
              <h5>问题{{ index + 1 }}：{{ item.content }}</h5>
              <div
                class="xx_list"
                v-for="(items, indexs) in item.answerList"
                :key="items.answerid"
              >
                选项{{ indexs }} {{ items.name }}
              </div>
            </div>
          </div>
        </el-dialog>
        <add-template ref="addTemplateDia" @sure="sure"></add-template>
      </div>
    </div>
  </template>
  
  <script>
  import stepsDemo from "@/views/selfCreate/components/Steps.vue";
  import addTemplate from '@/views/selfCreate/components/addDialog.vue'
  import ImgList from "@/components/imgUpload";
  import axios from "axios";
  import Cookies from 'js-cookie'
  import api from "@/api/index";
  export default {
    name: "stepsTwos",
    components: {
      ImgList: () => import("@/components/imgUpload"),
      stepsDemo,
      addTemplate
    },
    props: {
      isStep3: Boolean,
      secendData: Object,
    },
    data() {
      return {
        templateID: null,
        active: null,
        setpData: {
          step: 1,
          stepExamineOneStatus: 2,
          stepExaminetwoStatus: 1,
        },
        stepsObj: {
          list: [        "填写会议信息",
          "设置会议主题和嘉宾",
          "进行会议设置",
          "会议预约审核",],
          nums: 3,
        },
        formLinks: {
          email: "",
          linkname: "",
          tel: "",
        },
        mangeFrom: {
          email: "",
          linkname: "",
          tel: "",
        },
        AuthorsDia: false, //嘉宾
        LinksDia: false, //联系人弹窗
        MangeLinkDia: false, //管理联系人
        SZdialog: false, //设置问卷
        selectQuestionDia: false, //查看问卷详情
        checkType: [
          "姓名",
          "单位",
          "所属行业",
          "手机号",
          "邮箱",
          "地址",
          "单位类型",
          "职业类型",
        ],
        applyTypeData: [
          { name: "默认", value: 0 },
          { name: "手机号", value: 1 },
          { name: "手机号+邮箱", value: 2 },
        ],
        limitImg: 1,
        ImgList: [],
        changeImgStatus: true,
        ruleForm: {
          applyType: 0,
          isSetQuestion: 1,
          linkId: "",
          authorid: "",
          meetingImageVO:{
            appIndexImage:null,
            banner1:null,
            meeting1:null,
            seminarimg:null,
            wapbanner:null
          }
        },
        LinksData: [],
        AuthorsData: [],
        selectMeetingTemplateData: [],
        selectQuestion: [],
        isCanleave:false,
      };
    },
    mounted() {
      if (this.isStep3) {
        if (this.$route.query.mid) {
          this.getSecondData();
        }
        if (this.$route.query.id) {
          this.getDraftsMeetingInfo();
        }
        this.getAuthors();
        this.getLinks();
        this.selectMeetingTemplate();
      }
    },
    methods: {
      SZdialogfn(){
        this.SZdialog=true
      },
      sure(val){
     this.selectMeetingTemplate()
    },
      addTemplate(){
      this.$refs.addTemplateDia.addTemplateDia=true
    } ,
      //保存草稿箱
      saveDrafts() {
        this.ruleForm.questionlist = this.selectQuestion;
        if (this.ruleForm.meetingImageVO.appIndexImage&&this.ruleForm.meetingImageVO.appIndexImage.indexOf("https") > -1) {
        } else {
          this.ruleForm.meetingImageVO.appIndexImage =
            "https://img1.17img.cn/17img/" + this.ruleForm.meetingImageVO.appIndexImage;
        }

        if (this.ruleForm.meetingImageVO.banner1&&this.ruleForm.meetingImageVO.banner1.indexOf("https") > -1) {
        } else {
          this.ruleForm.meetingImageVO.banner1 =
            "https://img1.17img.cn/17img/" + this.ruleForm.meetingImageVO.banner1;
        }

        if (this.ruleForm.meetingImageVO.meeting1&&this.ruleForm.meetingImageVO.meeting1.indexOf("https") > -1) {
        } else {
          this.ruleForm.meetingImageVO.meeting1 =
            "https://img1.17img.cn/17img/" + this.ruleForm.meetingImageVO.meeting1;
        }

        if (this.ruleForm.meetingImageVO.seminarimg&&this.ruleForm.meetingImageVO.seminarimg.indexOf("https") > -1) {
        } else {
          this.ruleForm.meetingImageVO.seminarimg =
            "https://img1.17img.cn/17img/" + this.ruleForm.meetingImageVO.seminarimg;
        }

        if (this.ruleForm.meetingImageVO.wapbanner&&this.ruleForm.meetingImageVO.wapbanner.indexOf("https") > -1) {
        } else {
          this.ruleForm.meetingImageVO.wapbanner =
            "https://img1.17img.cn/17img/" + this.ruleForm.meetingImageVO.wapbanner
        }
        if (this.ruleForm.questionlist!=null&&this.ruleForm.questionlist.length>0) {
        this.ruleForm.questionlist.forEach(item => {
       item.codevalue='meeting'
    });
      }
        let form = {
          company: this.$store.state.root.companyData.webinarCompanyName,
          imshowid: this.$store.getters.imShowId,
          meettype: 3,
          meetinginfo: JSON.stringify(this.secendData.meetinginfo),
          subjectinfo:JSON.stringify(this.secendData.subjectinfo),
          questionotherinfo: JSON.stringify(this.ruleForm),
        };
        //判断从定制厂商会进来
        if (this.$route.query.meetType) {
          form.meettype = this.$route.query.meetType;
        }
        //判断从定制厂商会进来
        if (this.$route.query.id) {
          form.id = this.$route.query.id;
        }
        api.selfMeting.saveMeetingDraft(form).then((res) => {
          this.$message({ type: "success", message: "保存成功！" });
          this.$emit('isleavethree',true)
          if(this.$route.query.meetType){
          if (this.$route.query.meetType==3) {
            this.$router.push('/selfCreate/selfMeting')
          }else{
            this.$router.push('/custoMade/index')
          }
        }else{
          this.$router.push('/selfCreate/selfMeting')
        }
        });
      },
      // 确定之后立马调用问题列表
      choosetemplete() {
        this.SZdialog = false;
        let form = {
          imshowId: this.$store.getters.imShowId,
          mid: this.templateID,
        };
        api.selfMeting.selectQuestion(form).then((res) => {
          this.selectQuestion = res.data.question;
        });
      },
      //查看问卷内容
      checkTemplate() {
        this.selectQuestionDia = true;
      },
      //调查问卷模板列表
      selectMeetingTemplate() {
        let form = {
          imshowId: this.$store.getters.imShowId,
        };
        api.selfMeting.selectMeetingTemplate(form).then((res) => {
          this.selectMeetingTemplateData = res.data;
        });
      },
      changeLinkes(val, index) {
        this.active = index;
        this.mangeFrom = val;
      },
      mangePeople() {
        this.LinksDia = false;
        this.MangeLinkDia = true;
      },
      //删除
      deletedLink() {
        this.$confirm("此操作将永久删除该联系人, 是否继续?", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            let form = {
              imshowid: this.$store.getters.imShowId,
              id: this.mangeFrom.id,
            };
            api.selfMeting.deletedLink(form).then((res) => {
              this.$message({
                type: "success",
                message: "删除成功!",
              });
              this.MangeLinkDia = false;
              this.getLinks();
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消删除",
            });
          });
      },
      //添加/修改联系人
      saveLinks(val) {
        if (val && val == 2) {
          if (this.mangeFrom.email == "") {
            this.$message({ type: "error", message: "请输入邮箱" });
            return false;
          }
          if (this.mangeFrom.tel == "") {
            this.$message({ type: "error", message: "请输入邮箱" });
            return false;
          }
          api.selfMeting.saveLink(this.mangeFrom).then((res) => {
            this.$message({ type: "success", message: "修改成功！" });
            this.MangeLinkDia = false;
            this.MangeLinkDia();
          });
        } else {
          if (this.formLinks.email == "") {
            this.$message({ type: "error", message: "请输入邮箱" });
            return false;
          }
          if (this.formLinks.linkname == "") {
            this.$message({ type: "error", message: "请输入姓名" });
            return false;
          }
          if (this.formLinks.tel == "") {
            this.$message({ type: "error", message: "请输入手机号" });
            return false;
          }
          api.selfMeting.saveLink(this.formLinks).then((res) => {
            this.$message({ type: "success", message: "添加成功！" });
            this.LinksDia = false;
            this.getLinks();
          });
        }
      },
      //获取联系人
      getLinks() {
        let form = {
          imshowId: this.$store.getters.imShowId,
        };
        api.selfMeting.getLinks(form).then((res) => {
          this.LinksData = res.data;
        });
      },
      //获取嘉宾
      getAuthors() {
        let form = {
          imshowId: this.$store.getters.imShowId,
        };
        api.selfMeting.getAuthors(form).then((res) => {
          this.AuthorsData = res.data;
        });
      },
  
      changeType(val) {
        if (val == 0) {
          this.checkType = [
            "姓名",
            "单位",
            "手机号",
            "所属行业",
            "邮箱",
            "地址",
            "单位类型",
            "职业类型",
          ];
        } else if (val == 1) {
          this.checkType = ["手机号"];
        } else {
          this.checkType = ["手机号", "邮箱"];
        }
      },
      //获取第三步信息
      getSecondData() {
        let form = {
          imshowId: this.$store.getters.imShowId,
          mid: this.$route.query.mid,
        };
        api.selfMeting.getQuestionImage(form).then((res) => {
          this.ruleForm = res.data;
          if (
            this.ruleForm.questionlist &&
            this.ruleForm.questionlist.length > 0
          ) {
            this.templateID = "1";
            this.selectQuestion = this.ruleForm.questionlist;
          }
        });
      },
      // 获取草稿箱第三部信息
      getDraftsMeetingInfo() {
        let form = {
          id: this.$route.query.id,
          imshowId: this.$store.getters.imShowId,
        };
        api.selfMeting.getMeetingDraftById(form).then((res) => {
          if (JSON.parse(res.data.questionotherinfo)) {
            this.ruleForm = JSON.parse(res.data.questionotherinfo);
          }
          if (
            this.ruleForm.questionlist &&
            this.ruleForm.questionlist.length > 0
          ) {
            this.templateID = "1";
            this.selectQuestion = this.ruleForm.questionlist;
          }
        });
      },
      imgListSucenss1(data) {
        this.ImgList.push(JSON.parse(JSON.stringify(data)));
        this.ruleForm.meetingImageVO.banner1 = data.url;
      },
      imgListSucenss2(data) {
        this.ImgList.push(JSON.parse(JSON.stringify(data)));
        this.ruleForm.meetingImageVO.meeting1 = data.url;
      },
      imgListSucenss3(data) {
        this.ImgList.push(JSON.parse(JSON.stringify(data)));
        this.ruleForm.meetingImageVO.wapbanner = data.url;
      },
      imgListSucenss4(data) {
        this.ImgList.push(JSON.parse(JSON.stringify(data)));
        this.ruleForm.meetingImageVO.appIndexImage = data.url;
      },
      imgListSucenss5(data) {
        this.ImgList.push(JSON.parse(JSON.stringify(data)));
        this.ruleForm.meetingImageVO.seminarimg = data.url;
      },
      imgListDelete1(i) {
        this.ImgList.splice(i, 1);
        this.ruleForm.meetingImageVO.banner1 = "";
      },
      imgListDelete2(i) {
        this.ImgList.splice(i, 1);
        this.ruleForm.meetingImageVO.meeting1 = "";
      },
      imgListDelete3(i) {
        this.ImgList.splice(i, 1);
        this.ruleForm.meetingImageVO.wapbanner = "";
      },
      imgListDelete4(i) {
        this.ImgList.splice(i, 1);
        this.ruleForm.meetingImageVO.appIndexImage = "";
      },
      imgListDelete5(i) {
        this.ImgList.splice(i, 1);
        this.ruleForm.meetingImageVO.seminarimg = "";
      },
      againValidate() {
        this.$refs.ruleForm.validate((vaild) => {});
      },
      //提交
      submitForm(formName) {
        const passwordValid = Cookies.get('passwordValid')
  const username = Cookies.get('username')
  const mobile = Cookies.get('mobile')
  const CheckValid = Cookies.get('CheckValid')
   if (mobile && passwordValid && username && CheckValid) {


        if (this.ruleForm.applyType == "") {
          if (this.ruleForm.applyType != 0) {
            this.$message({ type: "error", message: "请设置报名字段！" });
            return false;
          }
        }
        if (!this.ruleForm.meetingImageVO.banner1||this.ruleForm.meetingImageVO.banner1 == "") {
          this.$message({ type: "error", message: "请设置电脑端会议详情页宣传图！" });
          return false;
        }
        if (!this.ruleForm.meetingImageVO.meeting1||this.ruleForm.meetingImageVO.meeting1 == "") {
          this.$message({ type: "error", message: "请设置电脑端首页宣传图！" });
          return false;
        }
        if (!this.ruleForm.meetingImageVO.wapbanner||this.ruleForm.meetingImageVO.wapbanner == "") {
          this.$message({ type: "error", message: "请设置手机端会议宣传图！" });
          return false;
        }
        if (!this.ruleForm.meetingImageVO.appIndexImage||this.ruleForm.meetingImageVO.appIndexImage == "") {
          this.$message({ type: "error", message: "请设置手机端首页轮播图！" });
          return false;
        }
        if (!this.ruleForm.meetingImageVO.seminarimg||this.ruleForm.meetingImageVO.seminarimg == "") {
          this.$message({ type: "error", message: "请设置微信分享图片！" });
          return false;
        }
 
        this.ruleForm.questionlist = this.selectQuestion;
        if (this.ruleForm.meetingImageVO.appIndexImage.indexOf("https") > -1) {
        } else {
          this.ruleForm.meetingImageVO.appIndexImage =
            "https://img1.17img.cn/17img/" + this.ruleForm.meetingImageVO.appIndexImage;
        }

        if (this.ruleForm.meetingImageVO.banner1.indexOf("https") > -1) {
        } else {
          this.ruleForm.meetingImageVO.banner1 =
            "https://img1.17img.cn/17img/" + this.ruleForm.meetingImageVO.banner1;
        }

        if (this.ruleForm.meetingImageVO.meeting1.indexOf("https") > -1) {
        } else {
          this.ruleForm.meetingImageVO.meeting1 =
            "https://img1.17img.cn/17img/" + this.ruleForm.meetingImageVO.meeting1;
        }

        if (this.ruleForm.meetingImageVO.seminarimg.indexOf("https") > -1) {
        } else {
          this.ruleForm.meetingImageVO.seminarimg =
            "https://img1.17img.cn/17img/" + this.ruleForm.meetingImageVO.seminarimg;
        }

        if (this.ruleForm.meetingImageVO.wapbanner.indexOf("https") > -1) {
        } else {
          this.ruleForm.meetingImageVO.wapbanner =
            "https://img1.17img.cn/17img/" + this.ruleForm.meetingImageVO.wapbanner
        }
        if (this.ruleForm.questionlist!=null&&this.ruleForm.questionlist.length>0) {
        this.ruleForm.questionlist.forEach(item => {
       item.codevalue='meeting'
    });
      }
  
        let form = {
          company: "仪器信息网展位",
          imshowid: this.$store.getters.imShowId,
          meetinginfo: this.secendData.meetinginfo,
          meettype: this.$route.query.meetType,
          questionotherinfo: this.ruleForm,
          subjectinfo:this.secendData.subjectinfo
        };
        if (this.$route.query.id) {
        form.draftId = this.$route.query.id;
      }
        api.selfMeting.saveCustomMeetingInfo(form).then((res) => {
          this.$message({ type: "success", message: "新增成功！" });
          this.$emit('isleavethree',true)
          this.$router.push("/custoMade/index");
        });

      }else{
          this.$emit('isleavethree',true)
      this.$router.push('/login?type=sign')
    }
      },
      resetForm(formName) {
        this.$refs[formName].resetFields();
      },
    },
  };
  </script>
  
  <style lang="scss" scoped>
  .question_body {
    height: 500px;
    overflow-y: auto;
    padding: 0 24px 24px;
    .question_list {
      padding-bottom: 20px;
      padding-top: 20px;
      border-bottom: 1px solid #e5eaf0;
      h5 {
        font-size: 14px;
        font-weight: 600;
        color: #000000;
        line-height: 24px;
        margin-bottom: 5px;
      }
      .xx_list {
        font-size: 14px;
        color: #7d7e80;
        line-height: 24px;
      }
    }
    .question_list:last-child {
      border-bottom: none;
    }
  }
  .wid340 {
    width: 340px !important;
  }
  .dia_flex {
    @include flex(row, flex-start, flex-start);
    .mange_left {
      width: 210px;
      height: 270px;
      overflow-y: auto;
      padding: 23px 0;
      border-right: 1px solid #e5eaf0;
      span {
        width: 106px;
        height: 32px;
        background: rgba(12, 127, 242, 0.1);
        border-radius: 4px 4px 4px 4px;
        border: 1px solid rgba(12, 127, 242, 0);
        font-size: 14px;
        color: #101010;
        text-align: center;
        overflow: hidden;
        line-height: 32px;
        display: block;
        margin: 0 auto;
        margin-bottom: 16px;
        cursor: pointer;
      }
      .active {
        font-weight: 600;
        border: 1px solid rgba(12, 127, 242, 0.4);
      }
    }
    .mange_right {
      padding: 60px 0 40px 38px;
      .wid280 {
        width: 280px !important;
      }
    }
    .mange_left::-webkit-scrollbar {
      /*滚动条整体样式*/
      width: 7px; /*高宽分别对应横竖滚动条的尺寸*/
      height: 1px;
    }
    .mange_left::-webkit-scrollbar-thumb {
      /*滚动条里面小方块*/
      border-radius: 8px 8px 8px 8px;
      background: #d9d9d9;
      width: 7px;
      height: 60px;
    }
    .mange_left::-webkit-scrollbar-track {
      /*滚动条里面轨道*/
      box-shadow: none;
      background: #fff;
    }
  }
  ::v-deep .mangedia .el-dialog__body {
    padding: 0px !important;
  }
  ::v-deep .el-upload--picture-card {
    width: 100px !important;
    height: 100px !important;
    line-height: 100px;
  }
  ::v-deep .el-upload-list--picture-card .el-upload-list__item {
    width: 100px !important;
    height: 100px !important;
    line-height: 100px;
  }
  .wid450 {
    width: 450px !important;
  }
  .formWidthdpl300 {
    width: 300px !important;
  }
  .wid200 {
    width: 200px !important;
  }
  .wid150 {
    width: 150px;
    margin-bottom: 16px;
  }
  .apply_right {
    flex-grow: 1;
    width: 50%;
    background: #fff;
    .right_form {
      border-top: 1px solid #f0f3f7;
    }
    .form_item {
      padding: 24px;
      .item {
        margin-bottom: 24px;
        .item_title {
          font-size: 16px;
          font-weight: 600;
          color: #202933;
          line-height: 19px;
          margin-bottom: 16px;
          .cole53 {
            color: #e53917 !important;
            padding-right: 7px;
          }
          .label {
            font-size: 14px;
            color: #7e8790;
            line-height: 16px;
            padding-left: 16px;
          }
        }
        .change_body {
          padding: 24px;
          background: #f9fafd;
          margin-top: 20px;
          .last_body {
            @include flex(row, center, flex-start);
            .wid330 {
              width: 330px;
              margin: 0 16px 0 44px;
            }
            .last_title {
              font-size: 14px;
              color: #202933;
              line-height: 16px;
              display: inline-block;
              width: 56px;
            }
            .mn_butn {
              display: inline-block;
              padding: 6px 20px;
              border-radius: 4px 4px 4px 4px;
              border: 1px solid #85bff8;
              font-size: 14px;
              color: #0c7ff2;
              cursor: pointer;
            }
            .ed_sz {
              color: #0c7ff2;
              cursor: pointer;
              padding-right: 24px;
            }
            .mn_butn:hover {
              background: #85bff833;
              transition: background 0.4s;
            }
          }
        }
      }
    }
  }
  .right_btm {
    margin-top: 100px;
    padding-top: 24px;
    border-top: 1px solid #e5eaf0;
    text-align: center;
  }
  ::v-deep .el-dialog__footer {
    padding-top: 0px;
    // border-top: 1px solid #e5eaf0;
  }
  ::v-deep .el-dialog__header {
    background: #f5f8fc;
    text-align: left;
    font-size: 16px;
    color: #202933;
    padding: 11px 16px;
  }
  ::v-deep .el-dialog__body {
    padding: 25px 25px 10px !important;
  }
  ::v-deep .el-dialog__title {
    font-size: 16px;
  }
  ::v-deep .el-form-item__label {
    text-align: left !important;
  }
  :v-deep .el-form-item:last-child {
    margin-bottom: 0px;
  }
  ::v-deep .el-upload-list--picture-card .el-upload-list__item-status-label i{
    right: 0;
    top: -34px;
    position: relative;
  }
  .gl_css {
    font-size: 14px;
    color: #0c7ff2;
    line-height: 16px;
    text-align: center;
    margin: 10px 0;
    cursor: pointer;
  }
  </style>